using MicroMsg.Common.Utils;
using MicroMsg.Manager;
using MicroMsg.Storage;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
namespace MicroMsg.UI.UserContrl
{
	public class TestContactItemCtrl : UserControl
	{
		private const string TAG = "TestContactItemCtrl";
		private bool mBIsFirstLoaded = true;
		internal ScrollViewer svRoot;
		internal StackPanel panelRoot;
		private bool _contentLoaded;
		public TestContactItemCtrl()
		{
			this.InitializeComponent();
			base.add_Loaded(new RoutedEventHandler(this.Control_Loaded));
			base.add_Unloaded(new RoutedEventHandler(this.Control_Unloaded));
		}
		private void Control_Loaded(object sender, RoutedEventArgs e)
		{
		}
		private void Control_Unloaded(object sender, RoutedEventArgs e)
		{
		}
		public void InitUI(string strUsrName)
		{
			Contact itemObject = StorageMgr.contact.method_0(strUsrName);
			Log.smethod_5("TestContactItemCtrl", "start create ContactListItem");
			ContactListItem[] array = new ContactListItem[11];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = new ContactListItem();
			}
			Log.smethod_5("TestContactItemCtrl", "end create ContactListItem");
			Log.smethod_5("TestContactItemCtrl", "start add to ctrl");
			ContactListItem[] array2 = array;
			for (int j = 0; j < array2.Length; j++)
			{
				ContactListItem contactListItem = array2[j];
				this.panelRoot.get_Children().Add(contactListItem);
			}
			Log.smethod_5("TestContactItemCtrl", "end  add to ctrl");
			Log.smethod_5("TestContactItemCtrl", "start set data");
			ContactListItem[] array3 = array;
			for (int k = 0; k < array3.Length; k++)
			{
				ContactListItem contactListItem2 = array3[k];
				contactListItem2.ItemObject = itemObject;
			}
			Log.smethod_5("TestContactItemCtrl", "end set data");
			Log.smethod_5("TestContactItemCtrl", "start set 5 header");
			string text = "*@&AB";
			for (int l = 0; l < 5; l++)
			{
				ContactsGroupHeader contactsGroupHeader = new ContactsGroupHeader();
				this.panelRoot.get_Children().Add(contactsGroupHeader);
				contactsGroupHeader.mStrKey = text.get_Chars(l).ToString();
			}
			Log.smethod_5("TestContactItemCtrl", "end set 5 header");
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/UI/LogView/TestContactItemCtrl.xaml", 2));
			this.svRoot = (ScrollViewer)base.FindName("svRoot");
			this.panelRoot = (StackPanel)base.FindName("panelRoot");
		}
	}
}
